#version 310 es

precision highp float;
precision highp int;
#define HLSLCC_ENABLE_UNIFORM_BUFFERS 1
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
#define UNITY_UNIFORM
#else
#define UNITY_UNIFORM uniform
#endif
#define UNITY_SUPPORTS_UNIFORM_LOCATION 1
#if UNITY_SUPPORTS_UNIFORM_LOCATION
#define UNITY_LOCATION(x) layout(location = x)
#define UNITY_BINDING(x) layout(binding = x, std140)
#else
#define UNITY_LOCATION(x)
#define UNITY_BINDING(x) layout(std140)
#endif
uniform 	vec4 _ScaledScreenParams;
uniform 	vec2 _GlobalMipBias;
uniform 	mediump vec4 _AmbientOcclusionParam;
uniform 	int _DebugMaterialMode;
uniform 	int _DebugMaterialValidationMode;
uniform 	int _DebugSceneOverrideMode;
uniform 	int _DebugLightingMode;
uniform 	mediump float _DebugValidateAlbedoMinLuminance;
uniform 	mediump float _DebugValidateAlbedoMaxLuminance;
uniform 	mediump float _DebugValidateAlbedoSaturationTolerance;
uniform 	mediump float _DebugValidateAlbedoHueTolerance;
uniform 	mediump vec3 _DebugValidateAlbedoCompareColor;
uniform 	mediump float _DebugValidateMetallicMinValue;
uniform 	mediump float _DebugValidateMetallicMaxValue;
uniform 	vec4 _DebugColor;
uniform 	vec4 _DebugColorInvalidMode;
uniform 	vec4 _DebugValidateBelowMinThresholdColor;
uniform 	vec4 _DebugValidateAboveMaxThresholdColor;
uniform 	vec4 _CascadeShadowSplitSpheres0;
uniform 	vec4 _CascadeShadowSplitSpheres1;
uniform 	vec4 _CascadeShadowSplitSpheres2;
uniform 	vec4 _CascadeShadowSplitSpheres3;
uniform 	vec4 _CascadeShadowSplitSphereRadii;
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
UNITY_BINDING(0) uniform UnityPerMaterial {
#endif
	UNITY_UNIFORM vec4                _BaseMap_ST;
	UNITY_UNIFORM mediump vec4                _BaseColor;
	UNITY_UNIFORM mediump float Xhlslcc_UnusedX_Cutoff;
	UNITY_UNIFORM mediump float                _Surface;
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
};
#endif
UNITY_LOCATION(0) uniform mediump sampler2D _BaseMap;
UNITY_LOCATION(1) uniform mediump sampler2D _ScreenSpaceOcclusionTexture;
in highp vec2 vs_TEXCOORD0;
in highp vec3 vs_TEXCOORD2;
in highp vec3 vs_TEXCOORD3;
layout(location = 0) out mediump vec4 SV_Target0;
vec3 u_xlat0;
mediump vec4 u_xlat16_0;
mediump vec4 u_xlat16_1;
vec4 u_xlat2;
mediump vec4 u_xlat16_2;
bvec4 u_xlatb2;
vec2 u_xlat3;
mediump float u_xlat16_3;
int u_xlati3;
bool u_xlatb3;
vec3 u_xlat4;
mediump vec4 u_xlat16_4;
bvec4 u_xlatb4;
vec3 u_xlat5;
mediump vec4 u_xlat16_5;
vec3 u_xlat6;
bool u_xlatb6;
mediump vec3 u_xlat16_7;
mediump vec4 u_xlat16_8;
vec3 u_xlat12;
int u_xlati12;
uint u_xlatu12;
bvec2 u_xlatb12;
bool u_xlatb15;
mediump float u_xlat16_17;
bool u_xlatb21;
mediump vec2 u_xlat16_25;
mediump float u_xlat16_26;
bool u_xlatb27;
bool u_xlatb30;
mediump float u_xlat16_34;
void main()
{
vec4 hlslcc_FragCoord = vec4(gl_FragCoord.xyz, 1.0/gl_FragCoord.w);
    u_xlat16_0 = texture(_BaseMap, vs_TEXCOORD0.xy, _GlobalMipBias.x);
    u_xlat16_1 = u_xlat16_0 * _BaseColor;
    u_xlatb27 = _DebugMaterialMode==9;
    if(u_xlatb27){
        u_xlat16_2.xyz = (-u_xlat16_0.xyz) * _BaseColor.xyz + vec3(1.0, 1.0, 1.0);
        u_xlat16_0.xyz = u_xlat16_2.xyz * vec3(0.400000006, 0.400000006, 0.400000006) + u_xlat16_1.xyz;
        u_xlat16_0.w = 1.0;
        u_xlati3 = int(0xFFFFFFFFu);
    } else {
        u_xlatb12.x = _DebugLightingMode==1;
        if(u_xlatb12.x){
            u_xlat12.xyz = vs_TEXCOORD2.xyz + (-_CascadeShadowSplitSpheres0.xyz);
            u_xlat4.xyz = vs_TEXCOORD2.xyz + (-_CascadeShadowSplitSpheres1.xyz);
            u_xlat5.xyz = vs_TEXCOORD2.xyz + (-_CascadeShadowSplitSpheres2.xyz);
            u_xlat6.xyz = vs_TEXCOORD2.xyz + (-_CascadeShadowSplitSpheres3.xyz);
            u_xlat2.x = dot(u_xlat12.xyz, u_xlat12.xyz);
            u_xlat2.y = dot(u_xlat4.xyz, u_xlat4.xyz);
            u_xlat2.z = dot(u_xlat5.xyz, u_xlat5.xyz);
            u_xlat2.w = dot(u_xlat6.xyz, u_xlat6.xyz);
            u_xlatb2 = lessThan(u_xlat2, _CascadeShadowSplitSphereRadii);
            u_xlat16_4.x = (u_xlatb2.x) ? float(1.0) : float(0.0);
            u_xlat16_4.y = (u_xlatb2.y) ? float(1.0) : float(0.0);
            u_xlat16_4.z = (u_xlatb2.z) ? float(1.0) : float(0.0);
            u_xlat16_4.w = (u_xlatb2.w) ? float(1.0) : float(0.0);
            u_xlat16_7.x = (u_xlatb2.x) ? float(-1.0) : float(-0.0);
            u_xlat16_7.y = (u_xlatb2.y) ? float(-1.0) : float(-0.0);
            u_xlat16_7.z = (u_xlatb2.z) ? float(-1.0) : float(-0.0);
            u_xlat16_7.xyz = u_xlat16_4.yzw + u_xlat16_7.xyz;
            u_xlat16_4.yzw = max(u_xlat16_7.xyz, vec3(0.0, 0.0, 0.0));
            u_xlat16_7.x = dot(u_xlat16_4, vec4(4.0, 3.0, 2.0, 1.0));
            u_xlat16_7.x = (-u_xlat16_7.x) + 4.0;
            u_xlatu12 = uint(u_xlat16_7.x);
            switch(int(u_xlatu12)){
                case 0:
                    u_xlat16_2.x = float(0.400000006);
                    u_xlat16_2.y = float(0.899999976);
                    u_xlat16_2.w = float(0.400000006);
                    break;
                case 1:
                    u_xlat16_2.x = float(0.899999976);
                    u_xlat16_2.y = float(0.400000006);
                    u_xlat16_2.w = float(0.400000006);
                    break;
                case 2:
                    u_xlat16_2.x = float(0.899999976);
                    u_xlat16_2.y = float(0.400000006);
                    u_xlat16_2.w = float(0.899999976);
                    break;
                case 3:
                    u_xlat16_2.x = float(0.400000006);
                    u_xlat16_2.y = float(0.400000006);
                    u_xlat16_2.w = float(0.899999976);
                    break;
                default:
                    u_xlat16_2.x = float(0.0);
                    u_xlat16_2.y = float(0.0);
                    u_xlat16_2.w = float(0.0);
                    break;
            }
            u_xlat16_0.x = float(0.0);
            u_xlat16_0.y = float(0.0);
            u_xlat16_0.z = float(0.0);
            u_xlat16_7.x = 1.0;
        } else {
            u_xlatb4 = equal(ivec4(ivec4(_DebugLightingMode, _DebugLightingMode, _DebugLightingMode, _DebugLightingMode)), ivec4(2, 3, 4, 5));
            {
                bvec2 hlslcc_orTemp = u_xlatb12;
                hlslcc_orTemp.x = u_xlatb4.y || u_xlatb4.x;
                hlslcc_orTemp.y = u_xlatb4.w || u_xlatb4.z;
                u_xlatb12 = hlslcc_orTemp;
            }
            u_xlat16_25.xy = (u_xlatb12.y) ? vec2(1.0, 1.0) : vec2(0.0, 1.0);
            u_xlat16_8.xyz = (u_xlatb12.y) ? vec3(0.0, 0.0, 0.0) : u_xlat16_1.xyz;
            u_xlat16_7.xy = (u_xlatb12.x) ? vec2(0.0, 0.0) : u_xlat16_25.yx;
            u_xlat16_2.xyw = (u_xlatb12.x) ? vec3(1.0, 1.0, 1.0) : u_xlat16_8.yzx;
            u_xlat16_0.xyz = u_xlat16_7.yyy;
        }
        u_xlat16_4 = (_DebugSceneOverrideMode != 0) ? _DebugColor : vec4(0.0, 0.0, 0.0, 0.0);
        if(_DebugSceneOverrideMode != 0) {
            u_xlat16_0 = u_xlat16_4;
            u_xlati3 = int(0xFFFFFFFFu);
        } else {
            switch(_DebugMaterialMode){
                case 0:
                    u_xlat16_0 = u_xlat16_4;
                    u_xlati12 = 0;
                    break;
                case 1:
                    u_xlat16_2.z = 1.0;
                    u_xlat16_0 = u_xlat16_2.wxyz;
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                case 2:
                    u_xlat16_0.w = 1.0;
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                case 3:
                    u_xlat16_8.x = u_xlat16_1.w;
                    u_xlat16_8.w = 1.0;
                    u_xlat16_0 = u_xlat16_8.xxxw;
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                case 4:
                    u_xlat16_7.y = 1.0;
                    u_xlat16_0 = u_xlat16_7.xxxy;
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                case 5:
                    u_xlat16_0.x = float(1.0);
                    u_xlat16_0.y = float(1.0);
                    u_xlat16_0.z = float(1.0);
                    u_xlat16_0.w = float(1.0);
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                case 6:
                    u_xlat16_0.x = float(0.0);
                    u_xlat16_0.y = float(0.0);
                    u_xlat16_0.z = float(0.0);
                    u_xlat16_0.w = float(1.0);
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                case 7:
                    u_xlat0.xyz = vs_TEXCOORD3.xyz * vec3(0.5, 0.5, 0.5) + vec3(0.5, 0.5, 0.5);
                    u_xlat16_0.xyz = u_xlat0.xyz;
                    u_xlat16_0.w = 1.0;
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                case 8:
                    u_xlat16_0.x = float(0.5);
                    u_xlat16_0.y = float(0.5);
                    u_xlat16_0.z = float(1.0);
                    u_xlat16_0.w = float(1.0);
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                case 10:
                    u_xlat16_0.x = float(0.0);
                    u_xlat16_0.y = float(0.0);
                    u_xlat16_0.z = float(0.0);
                    u_xlat16_0.w = float(1.0);
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
                default:
                    u_xlat16_0 = _DebugColorInvalidMode;
                    u_xlati12 = int(0xFFFFFFFFu);
                    break;
            }
            if(u_xlati12 != 0) {
                u_xlati3 = int(0xFFFFFFFFu);
            } else {
                switch(_DebugMaterialValidationMode){
                    case 0:
                        u_xlati3 = 0;
                        break;
                    case 1:
                        u_xlat16_7.x = dot(u_xlat16_2.wxy, vec3(0.212672904, 0.715152204, 0.0721750036));
                        u_xlatb12.x = u_xlat16_7.x<_DebugValidateAlbedoMinLuminance;
                        if(u_xlatb12.x){
                            u_xlat16_0 = _DebugValidateBelowMinThresholdColor;
                        } else {
                            u_xlatb12.x = _DebugValidateAlbedoMaxLuminance<u_xlat16_7.x;
                            u_xlatb21 = u_xlat16_2.x>=u_xlat16_2.y;
                            u_xlat16_25.x = (u_xlatb21) ? 1.0 : 0.0;
                            u_xlat16_4.xy = u_xlat16_2.yx;
                            u_xlat16_4.z = float(-1.0);
                            u_xlat16_4.w = float(0.666666687);
                            u_xlat16_5.xy = u_xlat16_2.xy + (-u_xlat16_4.xy);
                            u_xlat16_5.z = float(1.0);
                            u_xlat16_5.w = float(-1.0);
                            u_xlat16_4 = u_xlat16_25.xxxx * u_xlat16_5 + u_xlat16_4;
                            u_xlatb21 = u_xlat16_2.w>=u_xlat16_4.x;
                            u_xlat16_25.x = (u_xlatb21) ? 1.0 : 0.0;
                            u_xlat16_2.xyz = u_xlat16_4.xyw;
                            u_xlat16_4.xyw = u_xlat16_2.wyx;
                            u_xlat16_4 = (-u_xlat16_2) + u_xlat16_4;
                            u_xlat16_4 = u_xlat16_25.xxxx * u_xlat16_4 + u_xlat16_2;
                            u_xlat16_25.x = min(u_xlat16_4.y, u_xlat16_4.w);
                            u_xlat16_25.x = u_xlat16_4.x + (-u_xlat16_25.x);
                            u_xlat16_34 = (-u_xlat16_4.y) + u_xlat16_4.w;
                            u_xlat16_8.x = u_xlat16_25.x * 6.0 + 9.99999975e-05;
                            u_xlat16_34 = u_xlat16_34 / u_xlat16_8.x;
                            u_xlat16_34 = u_xlat16_4.z + u_xlat16_34;
                            u_xlat16_8.x = u_xlat16_4.x + 9.99999975e-05;
                            u_xlat16_25.x = u_xlat16_25.x / u_xlat16_8.x;
                            u_xlatb21 = _DebugValidateAlbedoCompareColor.y>=_DebugValidateAlbedoCompareColor.z;
                            u_xlat16_4.xy = _DebugValidateAlbedoCompareColor.zy;
                            u_xlat16_4.z = float(-1.0);
                            u_xlat16_4.w = float(0.666666687);
                            u_xlat16_5.xy = _DebugValidateAlbedoCompareColor.yz;
                            u_xlat16_5.z = float(0.0);
                            u_xlat16_5.w = float(-0.333333343);
                            u_xlat16_5 = (-u_xlat16_4) + u_xlat16_5;
                            u_xlat16_5 = (bool(u_xlatb21)) ? u_xlat16_5 : vec4(0.0, 0.0, 0.0, -0.0);
                            u_xlat16_4 = u_xlat16_4 + u_xlat16_5;
                            u_xlatb21 = _DebugValidateAlbedoCompareColor.x>=u_xlat16_4.x;
                            u_xlat16_5.xyz = u_xlat16_4.xyw;
                            u_xlat16_5.w = _DebugValidateAlbedoCompareColor.x;
                            u_xlat16_4.xyw = u_xlat16_5.wyx;
                            u_xlat16_4 = (-u_xlat16_5) + u_xlat16_4;
                            u_xlat16_4 = (bool(u_xlatb21)) ? u_xlat16_4 : vec4(0.0, 0.0, 0.0, 0.0);
                            u_xlat16_4 = u_xlat16_4 + u_xlat16_5;
                            u_xlat16_8.x = min(u_xlat16_4.y, u_xlat16_4.w);
                            u_xlat16_8.x = u_xlat16_4.x + (-u_xlat16_8.x);
                            u_xlat16_17 = (-u_xlat16_4.y) + u_xlat16_4.w;
                            u_xlat16_26 = u_xlat16_8.x * 6.0 + 9.99999975e-05;
                            u_xlat16_17 = u_xlat16_17 / u_xlat16_26;
                            u_xlat16_17 = u_xlat16_4.z + u_xlat16_17;
                            u_xlat16_26 = u_xlat16_4.x + 9.99999975e-05;
                            u_xlat16_8.x = u_xlat16_8.x / u_xlat16_26;
                            u_xlat16_26 = u_xlat16_8.x + (-_DebugValidateAlbedoSaturationTolerance);
                            u_xlatb21 = u_xlat16_25.x<u_xlat16_26;
                            u_xlat16_26 = abs(u_xlat16_17) + (-_DebugValidateAlbedoHueTolerance);
                            u_xlatb30 = abs(u_xlat16_34)<u_xlat16_26;
                            u_xlat16_26 = u_xlat16_26 + 1.0;
                            u_xlatb6 = abs(u_xlat16_34)<u_xlat16_26;
                            u_xlatb30 = u_xlatb30 && u_xlatb6;
                            u_xlatb21 = u_xlatb30 || u_xlatb21;
                            u_xlat16_8.x = u_xlat16_8.x + _DebugValidateAlbedoSaturationTolerance;
                            u_xlatb30 = u_xlat16_8.x<u_xlat16_25.x;
                            u_xlat16_25.x = abs(u_xlat16_17) + _DebugValidateAlbedoHueTolerance;
                            u_xlatb6 = u_xlat16_25.x<abs(u_xlat16_34);
                            u_xlat16_25.x = u_xlat16_25.x + -1.0;
                            u_xlatb15 = u_xlat16_25.x<abs(u_xlat16_34);
                            u_xlatb6 = u_xlatb15 && u_xlatb6;
                            u_xlatb30 = u_xlatb30 || u_xlatb6;
                            u_xlat16_7.y = 1.0;
                            u_xlat16_4 = (bool(u_xlatb30)) ? _DebugValidateAboveMaxThresholdColor : u_xlat16_7.xxxy;
                            u_xlat16_4 = (bool(u_xlatb21)) ? _DebugValidateBelowMinThresholdColor : u_xlat16_4;
                            u_xlat16_0 = (u_xlatb12.x) ? _DebugValidateAboveMaxThresholdColor : u_xlat16_4;
                        }
                        u_xlati3 = int(0xFFFFFFFFu);
                        break;
                    case 2:
                        u_xlatb12.x = 0.0<_DebugValidateMetallicMinValue;
                        u_xlatb21 = _DebugValidateMetallicMaxValue<0.0;
                        u_xlat16_7.x = dot(u_xlat16_2.wxy, vec3(0.212672904, 0.715152204, 0.0721750036));
                        u_xlat16_7.y = 1.0;
                        u_xlat16_2 = (bool(u_xlatb21)) ? _DebugValidateAboveMaxThresholdColor : u_xlat16_7.xxxy;
                        u_xlat16_0 = (u_xlatb12.x) ? _DebugValidateBelowMinThresholdColor : u_xlat16_2;
                        u_xlati3 = int(0xFFFFFFFFu);
                        break;
                    default:
                        u_xlat16_0 = _DebugColorInvalidMode;
                        u_xlati3 = int(0xFFFFFFFFu);
                        break;
                }
            }
        }
    }
    u_xlat16_0 = (int(u_xlati3) != 0) ? u_xlat16_0 : u_xlat16_1;
    u_xlat3.xy = vec2(1.0) / vec2(_ScaledScreenParams.xy);
    u_xlat3.xy = u_xlat3.xy * hlslcc_FragCoord.xy;
    u_xlat16_3 = texture(_ScreenSpaceOcclusionTexture, u_xlat3.xy, _GlobalMipBias.x).x;
    u_xlat3.x = u_xlat16_3 + -1.0;
    u_xlat3.x = _AmbientOcclusionParam.w * u_xlat3.x + 1.0;
    switch(_DebugLightingMode){
        case 2:
            u_xlat16_1.x = 0.5;
            break;
        case 3:
            u_xlat16_1.x = u_xlat3.x * 0.5;
            break;
        default:
            u_xlat16_1.x = u_xlat3.x;
            break;
    }
    SV_Target0.xyz = u_xlat16_0.xyz * u_xlat16_1.xxx;
    u_xlatb3 = _Surface==1.0;
    SV_Target0.w = (u_xlatb3) ? u_xlat16_0.w : 1.0;
    return;
}


// Keywords: DEBUG_DISPLAY _SCREEN_SPACE_OCCLUSION
// 